package com.xiaotu.constant;

import com.xiaotu.model.BasicMessageMode;

/**
 * @author 张晓
 * @create 2021-10-14 21:58
 */
public enum MessageType {

    BATTLE(1, BasicMessageMode.class);

    private Integer val;

    private Class<?> aclass;

    MessageType(Integer val, Class<?> aclass) {
        this.val = val;
        this.aclass = aclass;
    }

    public Integer getVal() {
        return this.val;
    }

    public static MessageType getMessageTypeByVal(Integer val) {
        for (MessageType value : MessageType.values()) {
            if (value.getVal().equals(val)) {
                return value;
            }
        }
        return null;
    }

}
